<?php
include './header.php';

// 获取新闻类型
$classify_cond = "LIMIT 1,4";
$classify = select_all('xib_new_ty', '*', $classify_cond);
$news_type = select_all('xib_new_ty');

// 获取新闻内容
$news_id = $_GET['news_id'];
$news_cond = "WHERE news_id = '{$news_id}'";
$news_one = select_one('xib_news', '*', $news_cond);
if(preg_match_all('/<p>(.*?)<\/p>/', $news_one['news_content'], $arr)){
    $news = $arr[1];
}

// 上一页的标题
$pre_id = $news_id - 1;
$pre_cond = "WHERE news_id = '{$pre_id}'";
$pre = select_one('xib_news', 'news_title', $pre_cond);
$pre_title = mb_substr($pre[0], 0, 5);

// 下一页的标题
$next_id = $news_id + 1;
$next_cond = "WHERE news_id = '{$next_id}'";
$next = select_one('xib_news', 'news_title', $next_cond);
$next_title = mb_substr($next[0], 0, 5);
// pre($next_cond);

include './views/information_detail.html';
include './footer.php';